package me.keiwu.user.controller.rpc;

import me.keiwu.user.domain.UserStatistics;
import me.keiwu.user.service.UserStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by kei on 07/02/2018.
 */
@RestController
@RequestMapping("/rpc/statistics")
public class UserStatisticsRpcController {

    @Autowired
    private UserStatisticsService userStatisticsService;

    @RequestMapping("incrStealCount")
    public void incrStealCount(Long userId) {
        userStatisticsService.incrStealGoldCount(userId);
    }


    @RequestMapping("get")
    public UserStatistics getUserStatistics(Long userId) {
        return userStatisticsService.getUserStatistics(userId);
    }


}
